from sympy import exp, diff, symbols,sin

x = symbols('x')

y_sin = sin(x)

print("正弦函数的高阶导数规律:")
for n in range(1, 9):
    derivative = diff(y_sin, x, n)
    print(f"sin⁽{n}⁾(x) = {derivative}")

# 验证循环规律
print("\n验证循环规律:")
for n in range(0, 9, 4):
    derivative_n = diff(y_sin, x, n)
    derivative_n_plus_4 = diff(y_sin, x, n+4)
    print(f"sin⁽{n}⁾(x) = sin⁽{n+4}⁾(x): {derivative_n.equals(derivative_n_plus_4)}")